package com.tomato.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;

@Data
@TableName("user")
@Schema(description = "用户信息实体")
public class User {
    @TableId(type = IdType.AUTO)
    @Schema(description = "主键，自增")
    private Long id;

    @Schema(description = "用户昵称，可重复")
    private String username;

    @Schema(description = "手机号，唯一且作为登录账号")
    private String phone;

    @Schema(description = "密码 MD5 32 位哈希值（无盐）")
    private String passwordHash;

    @Schema(description = "头像存放相对路径")
    private String avatarPath = "avatars/default.png";

    @Schema(description = "用户注册时间")
    private LocalDateTime createdAt;

    @Schema(description = "最后更新时间")
    private LocalDateTime updatedAt;
}